<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="http://www.petercorke.com/RVC/common/toolboxhelp.css">
    <title>M-File Help: colordistance</title>
  </head>
  <body>
  <table border="0" cellspacing="0" width="100%">
    <tr class="subheader">
      <td class="headertitle">M-File Help: colordistance</td>
      <td class="subheader-left"><a href="matlab:open colordistance">View code for colordistance</a></td>
    </tr>
  </table>
<h1>colordistance</h1><p><span class="helptopic">Colorspace distance</span></p><strong>d</strong> = <span style="color:red>colordistance</span>(<strong>im</strong>, <strong>rg</strong>) is the Euclidean distance on the rg-chromaticity
plane from coordinate <strong>rg</strong>=[r,g] to every pixel in the color image <strong>im</strong>.  <strong>d</strong> is
an image with the same dimensions as <strong>im</strong> and the value of each pixel is
the color space distance of the corresponding pixel in <strong>im</strong>.

<h2>Notes</h2>
<ul>
  <li>The output image could be thresholded to determine color similarity.</li>
  <li>Note that Euclidean distance in the rg-chromaticity space does not
correspond well with human perception of color differences.  Perceptually
uniform spaces such as Lab remedy this problem.</li>
</ul>
<h2>See also</h2>
<p>
<a href="matlab:doc colorspace">colorspace</a></p>
<hr>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
  <tr class="subheader" valign="top"><td>&nbsp;</td></tr></table>
<p class="copy">&copy; 1990-2011 Peter Corke.</p>
</body></html>